<%@ page language="java" contentType="text/html; charset=EUC-KR" pageEncoding="EUC-KR"%>
<%@ page import ="java.sql.*, java.util.*" %>
<% request.setCharacterEncoding("euc-kr"); %>
<%@ include file="db.jsp" %>

<%
	String num = request.getParameter("num");
	String pass = request.getParameter("pass");
	
	PreparedStatement pstmt = null;
	ResultSet rs = null;
	
	String strSQL = "SELECT pass FROM s_store WHERE num = ?";
	pstmt = conn.prepareStatement(strSQL);
	pstmt.setInt(1, Integer.parseInt(num));
	
	rs = pstmt.executeQuery();
	rs.next();
	
	String goodpass = rs.getString("pass").trim();
	if(pass.equals(goodpass))
	{
		response.sendRedirect("modify.jsp?num=" +num);
	}
	else
	{
		response.sendRedirect("modify_pass.jsp?num=" +num);
	}
	
	rs.close();
	pstmt.close();
	conn.close();
%>